<include file="__THEME__/header" />
<link href="../Public/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/highcharts/modules/exporting.js"></script>

<script type="text/javascript">
$(function () {
    var chart;
    
    $(document).ready(function () {
    	
    	// Build the chart
        $('#container').highcharts({
            chart: {
                plotBackgroundColor: null,
                plotBorderWidth: null,
                plotShadow: false
            },
            title: {
                text: '患者最常用的五种药与提及次数'
            },
            tooltip: {
        	    pointFormat: '{series.name} <b>{point.percentage:.1f}%</b><br>提及次数：<b>20<b>'
            },
            plotOptions: {
                pie: {
                    allowPointSelect: true,
                    cursor: 'pointer',
                    dataLabels: {
                        enabled: true
                    },
                    showInLegend: true
                }
            },
            series: [{
                type: 'pie',
                name: '所占比例：',
                data: [
                    ['药品一',   45.0],
                    ['药品二',   26.8],
                    {
                        name: '药品六',
                        y: 12.8,
                        sliced: true,
                        selected: true
                    },
                    ['药品三',    8.5],
                    ['药品四',     6.2],
                    ['药品五',   0.7]
                ]
            }]
        });
    });
    
});
</script>

<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<!-- 内容 begin  -->
<div class="content">
	<include file="__THEME__/banner" />
	<include file="__THEME__/apps_wide" />
	<div class="main" >
		<script type="text/javascript" src="../Public/Js/Common.js" ></script>
		<link href="__PUBLIC__/js/pagination/pagination.css" rel="stylesheet" type="text/css" />
		
		<div class="intro">
			<h2>注册病友用药统计及评价</h2>
		</div>
		<div class="layout">
			<div class="static-box">
				<div class="title">
					注册病友用药统计 &nbsp;
					<select name="categoryid" class="select">
						<volist name="categoryList" id="category">
							<option value="{$category['id']}" <eq name="categoryid" value="$category['id']">selected</eq> >
								{$category['title']}
							</option>
						</volist>
					</select>
				</div>
			</div>
			
			<div class="comment-box">
				<div class="title">我的用药体会</div>
				<volist name="medicineList" id="medicine">
				<div class="medicine-box">
					<div class="medicine-hd">{$medicine['name']}<span class="allow">&darr;</span></div>
					<div class="medicine-bd">
						<form method="post">
							<div class="assess">
								评价：
								<div class="item">
									<label>疗效</label>&nbsp;5颗星
								</div>
								<div class="item">
									<label>副作用</label>&nbsp;5颗星
								</div>
								<div class="item">
									<label>价格</label>&nbsp;5颗星
								</div>
							</div>
							<div class="comment">
								 评论：
								 <div>
						 			<textarea name="content" class="txt"></textarea>
								 </div>
							</div>
							<div class="c"></div>
							<input type="button" value="提交信息" class="sub-btn"  style="float:right;margin-right: 50px;margin-top:10px;"/>
						</form>
					</div>
				</div>
				</volist>
				
				<!-- <div class="medicine-box">
					<div class="medicine-hd">药物一<span class="allow">&darr;</span></div>
					<div class="medicine-bd">
						<form method="post">
							<div class="assess">
								评价：
								<div class="item">
									<label>疗效</label>&nbsp;5颗星
								</div>
								<div class="item">
									<label>副作用</label>&nbsp;5颗星
								</div>
								<div class="item">
									<label>价格</label>&nbsp;5颗星
								</div>
							</div>
							<div class="comment">
								 评论：
								 <div>
						 			<textarea name="content" class="txt"></textarea>
								 </div>
							</div>
							<div class="c"></div>
							<input type="submit" value="提交信息" class="sub-btn"  style="float:right;margin-right: 50px;margin-top:10px;"/>
						</form>
					</div>
				</div>	 -->			
			</div>
		</div>
		
		<input id="page" type="hidden" value="{$_GET['p']}">
	</div>
	<div class="c"></div>
</div>
<!-- 内容 end -->

<script type="text/javascript">
	$(function(){
		$("#category").change(function(){
			
			var categoryid = $(this).val();
	        $.post(APP+"/Index/getMedicineByCategoryId",{categoryid:categoryid},function(json){
	        	var json = eval("("+json+")");
	        	// alert(json.data);return false;
	            if(json.status == 1){
	            	$("#medicinebox").empty();
	            	$.each(json.data,function(key,value){
	            		$("#medicinebox").append(
	            			'<label><input type="checkbox" name="medicines[]" value='+key+' />'+value+'</label>'
	            		);
	            	});
	            }else{
					$("#medicinebox").html('<center>对不起，暂时还没有相关数据！<center>');
	            }
	        });		
			$('#'+type).show();
			$('#'+type).find("input").removeAttr("disabled");
		});
		
		$("#category").find("option[value={$gcid}]").attr("selected",true);
		$('#category').triggerHandler('change');
	});
	
	function winMedicine() {
		var categoryid = $("#category").children("option:selected").val();
		ymPrompt.win(APP+'/Index/addMedicine/categoryid/'+categoryid,350,200,'添加药物',null,null,null,{id:'a'})
	}
	

</script>


<include file="__THEME__/footer" />

